Fix reboot of PV domains when both kernel and bootloader are unspecified
authorEwan Mellor <ewan@xensource.com>
Thu, 28 Dec 2006 12:59:58 +0000 (12:59 +0000)
committerEwan Mellor <ewan@xensource.com>
Thu, 28 Dec 2006 12:59:58 +0000 (12:59 +0000)
(which is supposed to default to using pygrub).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendConfig.py

index 387bb8324cf4e18580e2dd909768465f8a811c9b..54573d4f13277b22e1b5cb510c4b5d871678893f 100644 (file)
@@ -1106,6 +1106,11 @@ class XendConfig(dict):
 
         self['PV_kernel'] = sxp.child_value(image_sxp, 'kernel','')
         self['PV_ramdisk'] = sxp.child_value(image_sxp, 'ramdisk','')
+        if not self['PV_bootloader'] and self['PV_kernel']:
+            # We've set PV_kernel using the call above, so now we need to set
+            # PV_bootloader as well, otherwise we're going to do the wrong
+            # thing on reboot.
+            self['PV_bootloader'] = 'pygrub'
         kernel_args = sxp.child_value(image_sxp, 'args', '')
         
         # attempt to extract extra arguments from SXP config